package cn.edu.bupt.freewings.forum.front.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.bupt.freewings.forum.common.UserType;
import cn.edu.bupt.freewings.forum.common.TopicType;
import cn.edu.bupt.freewings.forum.client.rest.TopicClient;
import cn.edu.bupt.freewings.forum.client.rest.UserClient;
import cn.edu.bupt.freewings.forum.front.Constants;
import cn.edu.bupt.freewings.forum.front.beans.UserBean;

/**
 * @author hubaiyu (hubaiyu@gmail.com)
 *
 */
public class ProjectController extends HttpServlet {
	public static final String PARAM_ID = "id";
	
	@Override
	protected void service(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		Integer projectId = Integer.valueOf(request.getParameter(PARAM_ID));
		TopicType.TopicList topics = new TopicClient().getByProjectId(projectId);
		request.setAttribute(Constants.TOPICS, topics);
		request.getRequestDispatcher("/project.jsp").forward(request, response);
	}
}